package cn.com.gzheroli.rabbitmq.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

@Component
public class FanoutQueueListener {

    private static final Logger logger = LoggerFactory.getLogger(FanoutQueueListener.class);

    /**
     * 
     * @param id 任务ID
     * @param type 任务名称
     * @return
     */
    @RabbitListener(queues = "ccs.queue.fanout1")
    public void helloFanout1(Object obj) {
        logger.debug("Received request for queue {}", "ccs.queue.fanout1");
    }
    /**
     * 
     * @param id 任务ID
     * @param type 任务名称
     * @return
     */
    @RabbitListener(queues = "ccs.queue.fanout2")
    public void helloFanout2(Object obj) {
        logger.debug("Received request for queue {}", "ccs.queue.fanout2");
        //返回执行结果（成功，失败）和ID
    }
}